#ifndef CONTEXTMANAGER_H
#define CONTEXTMANAGER_H

#include <QObject>
#include <QStackedWidget>

class ContextManager : public QObject
{
    Q_OBJECT
public:
    explicit ContextManager(QObject *parent = 0);
    ~ContextManager();

    void addContext(int uid);
    QList<int> currentContext() const;
    void removeContext(int uid);

    // gui context
    void addGuiContext(int uid, QWidget *w);
    void removeGuiContext(int uid);
    void setGuiContext(int uid);
    int currentGuiContext() const;
    QWidget * widget() {return m_stackedWidget;}

    QWidget * widgetForContext(int uid) const;
    int contextForWidget(QWidget * w) const;

signals:
    void currentChanged();

public slots:

private:
    QList<int> m_contexts;

    int m_currentGuiContext;
    QList<int> m_guiContexts;
    QStackedWidget * m_stackedWidget;
};

#endif // CONTEXTMANAGER_H
